# 使用while方法输入边长生成四个方向的直角三角形
n = int(input("请输入直角三角形的边长："))

print("\n1. 左上角直角三角形：")
i = 0
while i < n:
    j = 0
    while j < n - i:
        print("*", end="")
        j += 1
    print()
    i += 1

print("\n2. 左下角直角三角形：")
i = 0
while i < n:
    j = 0
    while j <= i:
        print("*", end="")
        j += 1
    print()
    i += 1

print("\n3. 右上角直角三角形：")
i = 0
while i < n:
    j = 0
    while j < n:
        if j < i:
            print(" ", end="")
        else:
            print("*", end="")
        j += 1
    print()
    i += 1

print("\n4. 右下角直角三角形：")
i = 0
while i < n:
    j = 0
    while j < n:
        if j < n - i - 1:
            print(" ", end="")
        else:
            print("*", end="")
        j += 1
    print()
    i += 1